
import Api from '@/database'
import { defineWrappedResponseHandler } from '../utils/handler'

const handler = defineEventHandler(async (e) => {
  const { from, to } = await readBody(e)
  return await Api.table.rename(from, to)
})

export default defineWrappedResponseHandler(handler)